*load data 
use "/Users/benjaminleo/Library/Mobile Documents/com~apple~CloudDocs/PGMs & Protest Empirics/PGM&Protest Paper/pgm_protest_full.dta"

*set seed
set seed 12345

*limit UOA to repressive states
drop if PTS_A < 3

*all PGMs 
logit NONVIOL lag_presence protest_peace_years pp_years_sq pp_years_cb vdem_civlib vdem_civlib_sq youth_bulge wbpopest wbgdppc2011est ONGOING lag_coup, robust cluster (continent_x)
fitstat

outreg2 using "results4nvmpc.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) replace


*non govt formed PGMs 
logit NONVIOL lag_not_govt_pgm protest_peace_years pp_years_sq pp_years_cb vdem_civlib vdem_civlib_sq youth_bulge wbpopest wbgdppc2011est ONGOING lag_coup, robust cluster (continent_x)
fitstat

outreg2 using "results4nvmpc.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) append



*government formed PGMs 
logit NONVIOL lag_govt_pgm protest_peace_years pp_years_sq pp_years_cb vdem_civlib vdem_civlib_sq youth_bulge wbpopest wbgdppc2011est ONGOING lag_coup, robust cluster (continent_x)

*calculating marginal effects 
margins, at(lag_govt_pgm =(0 1))
di  (.0327298 - .0499514) / .0499514
 di -.34476711 * 100

outreg2 using "results4nvmpc.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) append 

estat ic

*////////Violent Dissent 

gen lnmilex = log(milex)

logit VIOL lag_presence vd_peace_years vd_years_sq vd_years_cb vdem_civlib vdem_civlib_sq wbgdppc2011est lnmilex wbpopest ONGOING rugged total_size  natl_rents lag_coup, robust cluster (continent_x)
fitstat

outreg2 using "results4vmpc.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) replace

estat ic

logit VIOL lag_not_govt_pgm vd_peace_years vd_years_sq vd_years_cb vdem_civlib vdem_civlib_sq wbgdppc2011est lnmilex wbpopest ONGOING rugged total_size natl_rents lag_coup, robust cluster (continent_x)
fitstat

outreg2 using "results4vmpc.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) append

estat ic

logit VIOL lag_govt_pgm vd_peace_years vd_years_sq vd_years_cb vdem_civlib vdem_civlib_sq wbgdppc2011est lnmilex wbpopest ONGOING rugged total_size  natl_rents lag_coup, robust cluster (continent_x)
fitstat

*substantive effects 
margins, at(lag_govt_pgm =(0 1))
di .019845 - .027786  / .027786 
di -.980155* 100


outreg2 using "results4vmpc.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) append

estat ic



*robustness check 

*Excluding Years in Which Campaigns are ongoing
*////Non-violent
logit NONVIOL lag_presence protest_peace_years pp_years_sq pp_years_cb vdem_civlib vdem_civlib_sq youth_bulge wbpopest wbgdppc2011est ONGOING lag_coup if protest_peace_years != 1, robust cluster (continent_x)
fitstat

outreg2 using "results4nvmpcongoingexclu.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) replace

logit NONVIOL lag_not_govt_pgm protest_peace_years pp_years_sq pp_years_cb vdem_civlib vdem_civlib_sq youth_bulge wbpopest wbgdppc2011est ONGOING lag_coup if protest_peace_years != 1, robust cluster (continent_x)
fitstat

outreg2 using "results4nvmpcongoingexclu.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) append

logit NONVIOL lag_govt_pgm protest_peace_years pp_years_sq pp_years_cb vdem_civlib vdem_civlib_sq youth_bulge wbpopest wbgdppc2011est ONGOING lag_coup if protest_peace_years != 1, robust cluster (continent_x)
fitstat

outreg2 using "results4nvmpcongoingexclu.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) append

*////Violent 
logit VIOL lag_presence vd_peace_years vd_years_sq vd_years_cb vdem_civlib vdem_civlib_sq wbgdppc2011est lnmilex wbpopest ONGOING rugged total_size  natl_rents lag_coup if vd_peace_years != 1, robust cluster (continent_x)
fitstat

outreg2 using "results4vmpcongoingexclu.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is VMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) replace

logit VIOL lag_not_govt_pgm vd_peace_years vd_years_sq vd_years_cb vdem_civlib vdem_civlib_sq wbgdppc2011est lnmilex wbpopest ONGOING rugged total_size  natl_rents lag_coup if vd_peace_years != 1, robust cluster (continent_x)
fitstat

outreg2 using "results4vmpcongoingexclu.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is VMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) append

logit VIOL lag_govt_pgm vd_peace_years vd_years_sq vd_years_cb vdem_civlib vdem_civlib_sq wbgdppc2011est lnmilex wbpopest ONGOING rugged total_size  natl_rents lag_coup if vd_peace_years != 1, robust cluster (continent_x)
fitstat

outreg2 using "results4vmpcongoingexclu.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is VMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) append

*/////rare events logit 
*/////NONVIOL
relogit NONVIOL lag_presence protest_peace_years pp_years_sq pp_years_cb vdem_civlib vdem_civlib_sq youth_bulge wbpopest wbgdppc2011est ONGOING lag_coup, cluster (continent_x)

outreg2 using "results4nvmpcrelog.doc", word nonotes alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1  , Robust Standard Errors are clustered by continent) replace

relogit NONVIOL lag_not_govt_pgm protest_peace_years pp_years_sq pp_years_cb vdem_civlib vdem_civlib_sq youth_bulge wbpopest wbgdppc2011est ONGOING lag_coup, cluster (continent_x)

outreg2 using "results4nvmpcrelog.doc", word nonotes alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1  , Robust Standard Errors are clustered by continent) append

relogit NONVIOL lag_govt_pgm protest_peace_years pp_years_sq pp_years_cb vdem_civlib vdem_civlib_sq youth_bulge wbpopest wbgdppc2011est ONGOING lag_coup, cluster (continent_x)

outreg2 using "results4nvmpcrelog.doc", word nonotes alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1  , Robust Standard Errors are clustered by continent) append

*/////VIOL
relogit VIOL lag_presence vd_peace_years vd_years_sq vd_years_cb vdem_civlib vdem_civlib_sq wbgdppc2011est lnmilex wbpopest ONGOING rugged total_size  natl_rents lag_coup, cluster (continent_x)

outreg2 using "results4vmpcrelog.doc", word nonotes alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1  , Robust Standard Errors are clustered by continent) replace

relogit VIOL lag_not_govt_pgm vd_peace_years vd_years_sq vd_years_cb vdem_civlib vdem_civlib_sq wbgdppc2011est lnmilex wbpopest ONGOING rugged total_size  natl_rents lag_coup, cluster (continent_x)

outreg2 using "results4vmpcrelog.doc", word nonotes alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1  , Robust Standard Errors are clustered by continent) append

relogit VIOL lag_govt_pgm vd_peace_years vd_years_sq vd_years_cb vdem_civlib vdem_civlib_sq wbgdppc2011est lnmilex wbpopest ONGOING rugged total_size  natl_rents lag_coup, cluster (continent_x)

outreg2 using "results4vmpcrelog.doc", word nonotes alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1  , Robust Standard Errors are clustered by continent) append


*/////Probit 
*/////NONVIOL
probit NONVIOL lag_presence protest_peace_years pp_years_sq pp_years_cb vdem_civlib vdem_civlib_sq youth_bulge wbpopest wbgdppc2011est ONGOING lag_coup, cluster (continent_x)
fitstat

outreg2 using "results4nvmpcprob.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) replace

probit NONVIOL lag_not_govt_pgm protest_peace_years pp_years_sq pp_years_cb vdem_civlib vdem_civlib_sq youth_bulge wbpopest wbgdppc2011est ONGOING lag_coup, cluster (continent_x)
fitstat

outreg2 using "results4nvmpcprob.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) append

probit NONVIOL lag_govt_pgm protest_peace_years pp_years_sq pp_years_cb vdem_civlib vdem_civlib_sq youth_bulge wbpopest wbgdppc2011est ONGOING lag_coup, cluster (continent_x)
fitstat

outreg2 using "results4nvmpcprob.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) append

*/////VIOL
probit VIOL lag_presence vd_peace_years vd_years_sq vd_years_cb vdem_civlib vdem_civlib_sq wbgdppc2011est lnmilex wbpopest ONGOING rugged total_size  natl_rents lag_coup, robust cluster (continent_x)
fitstat

outreg2 using "results4vmpcprob.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is VMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) replace

probit VIOL lag_not_govt_pgm vd_peace_years vd_years_sq vd_years_cb vdem_civlib vdem_civlib_sq wbgdppc2011est lnmilex wbpopest ONGOING rugged total_size  natl_rents lag_coup, robust cluster (continent_x)
fitstat

outreg2 using "results4vmpcprob.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is VMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) append

probit VIOL lag_govt_pgm vd_peace_years vd_years_sq vd_years_cb vdem_civlib vdem_civlib_sq wbgdppc2011est lnmilex wbpopest ONGOING rugged total_size  natl_rents lag_coup, robust cluster (continent_x)
fitstat

outreg2 using "results4vmpcprob.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is VMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) append



*/////Semi-Official vs informal indicator 
xtset ccode year
gen lag_inf = L.presence_informal 
recode lag_inf (.=0)
gen lag_semi = L.presence_semiofficial
recode lag_semi (.=0)

*/////NONVIOL
logit NONVIOL lag_inf protest_peace_years pp_years_sq pp_years_cb vdem_civlib vdem_civlib_sq youth_bulge wbpopest wbgdppc2011est ONGOING lag_coup, robust cluster (continent_x)
fitstat

outreg2 using "resultsaltindnv.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable for Models 1 & 2 is NVMPC Onset, Dependent Variable for Models 3 & 4 is VMPC ONset , *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) replace

logit NONVIOL lag_semi protest_peace_years pp_years_sq pp_years_cb vdem_civlib vdem_civlib_sq youth_bulge wbpopest wbgdppc2011est ONGOING lag_coup, robust cluster (continent_x)
fitstat 

outreg2 using "resultsaltindnv.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is NVMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) append

*/////VIOL
logit VIOL lag_inf vd_peace_years vd_years_sq vd_years_cb vdem_civlib vdem_civlib_sq wbgdppc2011est lnmilex wbpopest ONGOING rugged total_size natl_rents lag_coup, robust cluster (continent_x)
fitstat

outreg2 using "resultsaltindv.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is VMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) replace 

logit VIOL lag_semi vd_peace_years vd_years_sq vd_years_cb vdem_civlib vdem_civlib_sq wbgdppc2011est lnmilex wbpopest ONGOING rugged total_size natl_rents lag_coup, robust cluster (continent_x)
fitstat

outreg2 using "resultsaltindv.doc", word nonotes lab bdec(3) pvalue addstat(Log pseudo-likelihood, e(ll)) nor2 title("Results") alpha(.001, .01, .05, .1) symbol(***, **, *, †) addnote(Dependent Variable is VMPC Onset, *** p<0.001 ** p<.01 * p<0.05 † p<.1 , Robust Standard Errors are clustered by continent) append






